package com.wmz.disruptor.handler;

import com.lmax.disruptor.EventHandler;
import com.wmz.disruptor.model.LongEvent;

/**
 * @author lihechun
 * @version 1.0
 * @description: 消费者：事件处理器； disruptor会回调此处理器的方法
 * @date 2024/11/29 23:15
 */
public class LongEventHandlerWithName implements EventHandler<LongEvent> {
    private String name;
    public LongEventHandlerWithName(String name) {
        this.name = name;
    }

    @Override
    public void onEvent(LongEvent event, long sequence, boolean endOfBatch) throws Exception {
        System.out.println(this.name + "：" + event.getValue());
    }
}
